# -*- coding: utf-8 -*-
# Author: xiantingDeng
# File: conftest.py
# Time: 16:55

import os

import pytest
import sys
import os

sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(""))))
from common.utils.file_util import get_time_report


def run(file):
    allure = os.path.join(get_time_report(), "allure")
    allure_report = os.path.join(get_time_report(), "allure_report")

    pytest.main(
        ["-s", "-v", f"{os.path.join(os.path.dirname(__file__),'case')}", f"--cmdopt={file}", "--alluredir", allure,
         "--verbose"])
    os.system(f"allure generate {allure} -o {allure_report} --clean")


if __name__ == '__main__':
    run("test")
    # print(os.path.join(os.path.dirname(__file__),"case"))